package cn.cqie.frame.mapper;

import cn.cqie.frame.bo.query.QueryStudentBo;
import cn.cqie.frame.entity.Student;
import cn.cqie.frame.vo.StudentVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 学生 Mapper 接口
 * </p>
 *
 * @author XYHL
 * @since 2021-10-09
 */
public interface StudentMapper extends BaseMapper<Student> {
    @Select("SELECT student.id, student.`name`, student.code, student.sex, student.mobile,clazz.`name` as clazzName,sys_user.account as userAccount\t\n" +
            "FROM" +
            "  student" +
            " JOIN clazz on clazz.id = student.clazzId" +
            " JOIN sys_user on sys_user.id = student.userId")
    List<StudentVo> listStudent(QueryStudentBo bo);
}
